package day03;

/**
 * 数组的复制
 * @author: yyfei  
 * @email:  yyfei123@qq.com
 */
public class CopyArray {
	public static void main(String[] args) {
		int[] arr1,arr2;
		arr1=new int[] {2,3,4,11,23,17,19};
		
		for(int i=0;i<arr1.length;i++) {
			System.out.print(arr1[i]+",");
		}
		
		
		arr2=arr1;//内存中不变，只是修改了存储的地址，所以改变后都会改变，不能称作数组的复制
		for(int i=0;i<arr2.length;i++) {
			if(i%2==0) {
				arr2[i]=i;
			}
		}
		System.out.println("\n");
		for(int i=0;i<arr2.length;i++) {
			System.out.print(arr2[i]+",");
		}
		System.out.println("\n");
		for(int i=0;i<arr1.length;i++) {
			System.out.print(arr1[i]+",");
		}
	}
}
